<?php
require_once($_SERVER['DOCUMENT_ROOT'] . "/defaultconf.mex");
MYTCONN();
if ($_SESSION[$SESSCD] == 800) {
    $getCond = 'htr_Tarifa = 0 AND OriNumero = 812';
} else {
    $getCond = 'OriNumero = ' . $_SESSION[$SESSCD];
}
if(!isset($_GET['dsCTR'])){$_GET['dsCTR'] = 76;}
$GET = $GLOBALS['MYT']->db_array("SELECT
			htr_ID,
			htr_Tasa,
			miso_Cod_Elite,
			CorrAlias,
			CorrNumero
		FROM origenes
    INNER JOIN hd_cambiosdia ON htr_Tarifa = OriCTRRef
    INNER JOIN hd_monedasiso ON miso_ID = htr_MonPagoISO
    INNER JOIN corresponsales ON CorrNumero = htr_Corresponsal
			WHERE {$getCond} AND htr_Pais = {$_GET['dsCTR']}");
$CGET = $GET[0];
?>
<table style="width:100%;padding:3px"  border="0" cellspacing="2" cellpadding="4">
    <tr bgcolor="#D9DBC1">
        <td>Correspondente</td>
        <td width="9%">Câmbio</td>
    </tr>
    <?php
    if (!isset($GET[1])) {
        echo '<tr><td colspan="7">Nao existem tarifas activas.</td></tr>';
    }
    for ($r = 1; $r <= $CGET; $r++) {
        echo '<tr bgcolor="' . gridlines($r) . '">
              <td>' . $GET[$r]['CorrAlias'] . '</td>
              <td>' . number_format($GET[$r]['htr_Tasa'], 4) . '</td>
		</tr>';
    }
    ?>
</table>